package com.xiaoyu.base.entity;

import androidx.room.Entity;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import androidx.annotation.NonNull;

// type;
// mentionAll;
// mentionListString;
// ioType;

@Entity(tableName = "message", indices = {@Index("chatId"), @Index(value = "localId", unique = true), @Index("type")})
public class MessageEntity {

    @PrimaryKey
    @NonNull
    private String id;
    private String localId;
    private String cid;
    private String senderUid;
    private String targetUid;
    private int type;
    private long time;
    private String content;
    private boolean mentionAll;
    private String mentionListString;
    private int ioType; // seems wrong
    private int status;
    private int idType;
    @NonNull
    private String chatId;
    private int syncPoint;
    private int payloadVersion;
    private long displayTime;
    private boolean invisible;
    private boolean invisibleLastContent;
    private int readReceipt;
    private String text;
    private String attributes;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLocalId() {
        return localId;
    }

    public void setLocalId(String localId) {
        this.localId = localId;
    }

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    public String getSenderUid() {
        return senderUid;
    }

    public void setSenderUid(String senderUid) {
        this.senderUid = senderUid;
    }

    public String getTargetUid() {
        return targetUid;
    }

    public void setTargetUid(String targetUid) {
        this.targetUid = targetUid;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isMentionAll() {
        return mentionAll;
    }

    public void setMentionAll(boolean mentionAll) {
        this.mentionAll = mentionAll;
    }

    public String getMentionListString() {
        return mentionListString;
    }

    public void setMentionListString(String mentionListString) {
        this.mentionListString = mentionListString;
    }

    public int getIoType() {
        return ioType;
    }

    public void setIoType(int ioType) {
        this.ioType = ioType;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getIdType() {
        return idType;
    }

    public void setIdType(int idType) {
        this.idType = idType;
    }

    public String getChatId() {
        return chatId;
    }

    public void setChatId(String chatId) {
        this.chatId = chatId;
    }

    public int getSyncPoint() {
        return syncPoint;
    }

    public void setSyncPoint(int syncPoint) {
        this.syncPoint = syncPoint;
    }

    public int getPayloadVersion() {
        return payloadVersion;
    }

    public void setPayloadVersion(int payloadVersion) {
        this.payloadVersion = payloadVersion;
    }

    public long getDisplayTime() {
        return displayTime;
    }

    public void setDisplayTime(long displayTime) {
        this.displayTime = displayTime;
    }

    public boolean isInvisible() {
        return invisible;
    }

    public void setInvisible(boolean invisible) {
        this.invisible = invisible;
    }

    public int getReadReceipt() {
        return readReceipt;
    }

    public void setReadReceipt(int readReceipt) {
        this.readReceipt = readReceipt;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getAttributes() {
        return attributes;
    }

    public void setAttributes(String attributes) {
        this.attributes = attributes;
    }

    public boolean isInvisibleLastContent() {
        return invisibleLastContent;
    }

    public void setInvisibleLastContent(boolean invisibleLastContent) {
        this.invisibleLastContent = invisibleLastContent;
    }

    @Override
    public String toString() {
        return "MessageEntity{" +
                "id='" + id + '\'' +
                ", localId='" + localId + '\'' +
                ", cid='" + cid + '\'' +
                ", senderUid='" + senderUid + '\'' +
                ", targetUid='" + targetUid + '\'' +
                ", type=" + type +
                ", time=" + time +
                ", content='" + content + '\'' +
                ", mentionAll=" + mentionAll +
                ", mentionListString='" + mentionListString + '\'' +
                ", ioType=" + ioType +
                ", status=" + status +
                ", idType=" + idType +
                ", chatId='" + chatId + '\'' +
                ", syncPoint=" + syncPoint +
                ", payloadVersion=" + payloadVersion +
                ", displayTime=" + displayTime +
                ", invisible=" + invisible +
                ", invisibleLastContent=" + invisibleLastContent +
                ", readReceipt=" + readReceipt +
                ", text='" + text + '\'' +
                ", attributes='" + attributes + '\'' +
                '}';
    }
}
